package scenic.toolkit;

import java.awt.geom.Rectangle2D;

import scenic.Color;
import scenic.Graphics;

public class LabelView extends ComponentView {
	public LabelView(LabelModel model) {
		super(model);
	}
	
	public LabelModel getModel() {
		return (LabelModel)super.getModel();
	}
	
	public void paint(Graphics g) {
		g.clear();
		g.setFont(getModel().getFont().getAwtFont());
		Rectangle2D bounds = g.getTextLogicalBounds(getModel().getText().toString());
		g.translate(0, -bounds.getY());
		g.setFillColor(new Color(0.0f));
		g.drawText(getModel().getText().toString());
	}
}
